R Markdown

wells <- readOGR("pa_drilling_2000_2016.geojson")
## OGR data source with driver: GeoJSON 
## Source: "C:\Users\jared\Desktop\Fall 2019\R Shiny\hw2_jjkohler\pa_drilling_2000_2016.geojson", layer: "pa_drilling_2000_2016"
## with 47398 features
## It has 5 fields
pipelines <- readOGR('natural_gas_pipelines_j96.json')
## OGR data source with driver: GeoJSON 
## Source: "C:\Users\jared\Desktop\Fall 2019\R Shiny\hw2_jjkohler\natural_gas_pipelines_j96.json", layer: "natural_gas_pipelines_j96"
## with 327 features
## It has 4 fields, of which 1 list fields
fields <- readOGR('location_of_the_worlds_petroleum_fields__xtl.json')
## OGR data source with driver: GeoJSON 
## Source: "C:\Users\jared\Desktop\Fall 2019\R Shiny\hw2_jjkohler\location_of_the_worlds_petroleum_fields__xtl.json", layer: "location_of_the_worlds_petroleum_fields__xtl"
## with 1273 features
## It has 22 fields, of which 1 list fields

Oil and Gas Wells Drilled in the State of PA (2000-2019)

The map shows new wells drilled in Pennsylvania since the year 2000. Wells are color-coded by type. The data is a lightly cleaned version of the dataset found here: https://www.pasda.psu.edu/uci/DataSummary.aspx?dataset=1088

pal <- colorFactor(c("darkmagenta", "indianred2", 'darkgoldenrod1', 'blue', 'lightblue', 'darkgreen'), 
                   domain=c('COMB. OIL&GAS', 'GAS', 'INJECTION', 'MULTIPLE WELL BORE TYPE', 'OBSERVATION', 'OIL'))




m <- leaflet(data = wells) %>% 
  addProviderTiles("CartoDB.PositronNoLabels", group='Monotone') %>% 
  addProviderTiles("Stamen.TerrainBackground", group='Terrain') %>% 
  addMapPane(name = "dots", zIndex = 410) %>%
  # addMapPane(name = "maplabels", zIndex = 500) %>% # higher zIndex rendered on top
  addCircles(popup = ~as.character(well_type),
                   label = ~as.character(well_type),
                   radius = 1,
                   color = ~pal(well_type),
                   stroke = FALSE, 
                   fillOpacity =0.7,
                   group = "Well Locations",
                   options = pathOptions(pane='dots')) %>%
  addProviderTiles("CartoDB.PositronOnlyLabels",
                   options=leafletOptions(zIndex=480),
                   group = "map labels") %>%
  addLayersControl(baseGroups = c("Terrain","Monotone"),
                   overlayGroups = c("map labels","Well Locations")) %>%
      addLegend("bottomright", pal = pal, values = ~well_type,
    title = "Well Type ",
    opacity = 0.6)
m

Natural Gas Pipelines

Taken from the Harvard World Map datasets found at: https://worldmap.harvard.edu/data/geonode:natural_gas_pipelines_j96

m2 <- leaflet(data = pipelines) %>%
  setView(60, 40, zoom = 2) %>%
  addPolylines(weight = 1, color = 'green',
               opacity=0.7,
               popup = ~as.character(Name),
               label = ~as.character(Name),
               smoothFactor = 0.1,
               highlightOptions =
                 highlightOptions(color = "white",
                                  weight = 3,
                                  bringToFront = F,
                                  opacity = .7)) %>%
  addProviderTiles("CartoDB.DarkMatter", group='Monotone')

m2

World Oil and Gas Fields

Data found here: https://worldmap.harvard.edu/data/geonode:location_of_the_worlds_petroleum_fields__xtl

pal1 <- colorFactor(c("gray", "red", 'forestgreen', 'darkmagenta'), 
                   domain=c('---', 'gas', 'oil', 'oil and gas'))

m3 <- leaflet(data = fields) %>% 
  addPolygons(weight = 0, 
              smoothFactor = 0.5,
              opacity = 0, 
              fillOpacity = 1,
              label = fields@data[["NAME"]],
              fillColor = ~pal1(RESINFO),
              highlightOptions = highlightOptions(weight = 5,
                                                  color = "white",
                                                  fillOpacity = 0.7,
                                                  bringToFront = TRUE))  %>% 
  addProviderTiles("CartoDB.DarkMatter")

m3